/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Author: Huawei OS Kernel Lab
 * Create: Thu Aug 15 16:14:23 2023
 */

#ifndef __LIBLINUX_NETLINK_H__
#define __LIBLINUX_NETLINK_H__

#ifdef CONFIG_LIBLINUX
extern int liblinux_netlink_pal_unicast(struct sk_buff *skb, int proto, unsigned int dst_portid);
extern int liblinux_netlink_pal_multicast(struct sk_buff *skb, int proto, unsigned int dst_grp);

extern int liblinux_netlink_genl_pal_reg(const char *name, const void *fam_info,
				unsigned long info_len, unsigned int *fam_id_inout,
				unsigned int *mcgroup_offset_out);
extern int liblinux_netlink_genl_pal_unreg(unsigned int fam_id);
extern int liblinux_netlink_rtnl_pal_reg(const char *name);
extern int liblinux_netlink_rtnl_pal_unreg(const char *name);
struct genl_family;
extern int __pre_alloc_genl_family_res(struct genl_family *family);
extern void __free_pre_res_of_genl_family(const struct genl_family *family);

extern int netlink_pal_proto_register(unsigned int unit, unsigned int nr_grp);
extern int netlink_pal_proto_unregister(unsigned int unit);

#define NL_DUMP_MSG_NUM_LIMIT	256

#endif /* CONFIG_LIBLINUX */
#endif /* __LIBLINUX_NETLINK_H__ */
